# -*- coding: utf-8 -*-

# Copyright (c) JoinQuant Development Team
# Author: Huayong Kuang <kuanghuayong@joinquant.com>

class classproperty(object):
    """ @classmethod+@property """
    def __init__(self, f):
        self.f = classmethod(f)
    def __get__(self, *a):
        print("------", a)
        return self.f.__get__(*a)()


class MyClass(object):

     @classproperty
     def foo(cls):
        return 1

     @classproperty
     def bar(cls):
        return 2


mc = MyClass()
print(mc.foo, mc.bar)
print(MyClass.foo, MyClass.bar)
